package com.hue.netty.day02.five;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/*
    服务端的编码器
 */
public class ServerLongToByteHandler extends MessageToByteEncoder<Long> {
    @Override
    protected void encode(ChannelHandlerContext ctx, Long msg, ByteBuf out) throws Exception {
        System.out.println("服务端调用了编码器");
        out.writeLong(msg);
    }
}
